package com.antaohua.platfrom.system.service;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

//import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

//import com.antaohua.platfrom.framework.base.exception.InsertEntityException;
import com.antaohua.platfrom.framework.base.exception.QureyEntityException;
import com.antaohua.platfrom.framework.base.service.BaseServiceImpl;
//import com.antaohua.platfrom.system.entity.SysRoleEntity;
import com.antaohua.platfrom.system.entity.SysUserEntity;
//import com.antaohua.platfrom.system.service.SysRoleService;

@Transactional
@Service
public class SysUserServiceImpl  extends BaseServiceImpl<SysUserEntity> implements SysUserService{

//	@Autowired
//	private SysRoleService roleService;

	public SysUserEntity login(String emal,String password) throws QureyEntityException{
		Map<String, Object> propertys = new HashMap<String, Object>();
		propertys.put("userEmail", emal);
		propertys.put("password", password);
		List<SysUserEntity> selectResult = dao.findByPropertys(propertys);
		if(selectResult.size()==1){
			return selectResult.get(0);
		}else{
			return null;
		}
	}
}
